package com.xudow.app.newui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.xudow.app.newui.fragment.SupervisionFragment;

/**
 * 教学督导FragmentAdapter
 * Created by Administrator on 2016/6/26.
 */
public class SupervisionFragmentAdapter extends FragmentPagerAdapter {

    private final int PAGER_COUNT=4;
    private SupervisionFragment sf1,sf2,sf3,sf4;

    public SupervisionFragmentAdapter(FragmentManager fm) {
        super(fm);
        sf1=new SupervisionFragment();
        sf2=new SupervisionFragment();
        sf3=new SupervisionFragment();
        sf4=new SupervisionFragment();
    }

    @Override
    public Fragment getItem(int position) {
        SupervisionFragment sf=null;
        switch (position){
            case 0:
                sf=sf1;
                sf.setTitle("sf1");
                break;
            case 1:
                sf=sf2;
                sf.setTitle("sf2");
                break;
            case 2:
                sf=sf3;
                sf.setTitle("sf3");
                break;
            case 3:
                sf=sf4;
                sf.setTitle("sf4");
                break;
        }
        return sf;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
        return super.instantiateItem(container, position);
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        super.destroyItem(container, position, object);
    }

    @Override
    public int getCount() {
        return PAGER_COUNT;
    }
}
